//
// CZoneLighter.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;

public class CZoneLighter {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CZoneLighter(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CZoneLighter obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CZoneLighter(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CZoneLighter() {
    this(nel3dJNI.new_CZoneLighter(), true);
  }

  public void init() {
    nel3dJNI.CZoneLighter_init(swigCPtr, this);
  }

  public void light(CLandscape landscape, CZone output, long zoneToLight, SWIGTYPE_p_NL3D__CZoneLighter__CLightDesc description, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t obstacles, Vector_uint16 listZone) {
    nel3dJNI.CZoneLighter_light(swigCPtr, this, CLandscape.getCPtr(landscape), landscape, CZone.getCPtr(output), output, zoneToLight, SWIGTYPE_p_NL3D__CZoneLighter__CLightDesc.getCPtr(description), SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t.getCPtr(obstacles), Vector_uint16.getCPtr(listZone), listZone);
  }

  public void computeTileFlagsOnly(CLandscape landscape, CZone output, long zoneToLight, SWIGTYPE_p_NL3D__CZoneLighter__CLightDesc description, Vector_uint16 listZone) {
    nel3dJNI.CZoneLighter_computeTileFlagsOnly(swigCPtr, this, CLandscape.getCPtr(landscape), landscape, CZone.getCPtr(output), output, zoneToLight, SWIGTYPE_p_NL3D__CZoneLighter__CLightDesc.getCPtr(description), Vector_uint16.getCPtr(listZone), listZone);
  }

  public void addTriangles(CLandscape landscape, Vector_uint16 listZone, long order, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t triangleArray) {
    nel3dJNI.CZoneLighter_addTriangles__SWIG_0(swigCPtr, this, CLandscape.getCPtr(landscape), landscape, Vector_uint16.getCPtr(listZone), listZone, order, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t.getCPtr(triangleArray));
  }

  public void addTriangles(IShape shape, SWIGTYPE_p_NLMISC__CMatrix modelMT, SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t triangleArray) {
    nel3dJNI.CZoneLighter_addTriangles__SWIG_1(swigCPtr, this, IShape.getCPtr(shape), shape, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(modelMT), SWIGTYPE_p_std__vectorT_NLMISC__CTriangle_t.getCPtr(triangleArray));
  }

  public void addLightableShape(IShape shape, SWIGTYPE_p_NLMISC__CMatrix modelMT) {
    nel3dJNI.CZoneLighter_addLightableShape(swigCPtr, this, IShape.getCPtr(shape), shape, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(modelMT));
  }

  public void addWaterShape(CWaterShape shape, SWIGTYPE_p_NLMISC__CMatrix MT) {
    nel3dJNI.CZoneLighter_addWaterShape(swigCPtr, this, CWaterShape.getCPtr(shape), shape, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(MT));
  }

  public long getNumWaterShape() {
    return nel3dJNI.CZoneLighter_getNumWaterShape(swigCPtr, this);
  }

  public static boolean isLightableShape(IShape shape) {
    return nel3dJNI.CZoneLighter_isLightableShape(IShape.getCPtr(shape), shape);
  }

  public void progress(String message, float progress) {
    nel3dJNI.CZoneLighter_progress(swigCPtr, this, message, progress);
  }

  public float attenuation(CVector pos, SWIGTYPE_p_NL3D__CZoneLighter__CLightDesc description) {
    return nel3dJNI.CZoneLighter_attenuation(swigCPtr, this, CVector.getCPtr(pos), pos, SWIGTYPE_p_NL3D__CZoneLighter__CLightDesc.getCPtr(description));
  }

  public void addStaticPointLight(CPointLightNamed pln) {
    nel3dJNI.CZoneLighter_addStaticPointLight(swigCPtr, this, CPointLightNamed.getCPtr(pln), pln);
  }

  public void set_ZBufferLandscape(SWIGTYPE_p_std__vectorT_NL3D__CZBuffer_t value) {
    nel3dJNI.CZoneLighter__ZBufferLandscape_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CZBuffer_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_NL3D__CZBuffer_t get_ZBufferLandscape() {
    long cPtr = nel3dJNI.CZoneLighter__ZBufferLandscape_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_NL3D__CZBuffer_t(cPtr, false);
  }

  public void set_ZBufferObject(SWIGTYPE_p_NL3D__CZoneLighter__CZBuffer value) {
    nel3dJNI.CZoneLighter__ZBufferObject_set(swigCPtr, this, SWIGTYPE_p_NL3D__CZoneLighter__CZBuffer.getCPtr(value));
  }

  public SWIGTYPE_p_NL3D__CZoneLighter__CZBuffer get_ZBufferObject() {
    long cPtr = nel3dJNI.CZoneLighter__ZBufferObject_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NL3D__CZoneLighter__CZBuffer(cPtr, false);
  }

}
